﻿Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Drawing

Namespace SRAGWM
    Public Class LegendEntry
        'Fields
        Dim _SymbologyStyle As Integer
        Dim _SymbologyWeight As Integer
        Dim _FillColor As Color
        Dim _BorderColor As Color
        Dim _Filter As Filter
        Dim _DataSource As DataSource
        Dim _objSym As MAPSRVCOMPONENTSLib.GWMFeatureSymbology
        Dim _Tooltip As String
        'Dim _DataSource As Leg.DataSource = New Leg.DataSource
        'Dim _Filter As Leg.Filter


        'Properties
        Property SymbologyStyle() As Integer
            Get
                Return _SymbologyStyle
            End Get
            Set(ByVal value As Integer)
                _SymbologyStyle = value
            End Set
        End Property
        Property SymbologyWeight() As Integer
            Get
                Return _SymbologyWeight
            End Get
            Set(ByVal value As Integer)
                _SymbologyWeight = value
            End Set
        End Property
        Property FillColor() As Color
            Get
                Return _FillColor
            End Get
            Set(ByVal value As Color)
                _FillColor = value
            End Set
        End Property
        Property BorderColor() As Color
            Get
                Return _BorderColor
            End Get
            Set(ByVal value As Color)
                _BorderColor = value
            End Set
        End Property
        Property Filter() As Filter
            Get
                Return _Filter
            End Get
            Set(ByVal value As Filter)
                _Filter = value
            End Set
        End Property
        Property DataSource() As DataSource
            Get
                Return _DataSource
            End Get
            Set(ByVal value As DataSource)
                _DataSource = value
            End Set
        End Property
        Property Tooltip() As String
            Get
                Return _Tooltip
            End Get
            Set(ByVal value As String)
                _Tooltip = value
            End Set
        End Property
        'Property ObjSym() As MAPSRVCOMPONENTSLib.GWMFeatureSymbology
        '    Get
        '        Return _objSym
        '    End Get
        '    Set(ByVal value As MAPSRVCOMPONENTSLib.GWMFeatureSymbology)
        '        _objSym = value
        '    End Set
        'End Property
        ''SymbologyStyle = symb...
        ''Methods
        'Sub Display()
        '    'Dim objSym As MAPSRVCOMPONENTSLib.GWMFeatureSymbology
        '    _DataSource = New Leg.DataSource

        '    objDisplayRule = ObjMkr.NewDisplayRule
        '    ObjSym = objMS.CreateObject("GMWebMap.GWMFeatureSymbology")
        '    ObjSym.Color = RGB(BorderColor.R, BorderColor.G, BorderColor.B)
        '    ObjSym.Weight = pSymbologyWeight
        '    ObjSym.Style = pSymbologyStyle
        '    ObjSym.FillColor = RGB(FillColor.R, FillColor.G, FillColor.B)
        '    objDisplayRule.DisplaySymbology = ObjSym
        '    'Dim f As Filter = New Filter(

        'End Sub
        'Cosntructors
        Public Sub New(ByVal pSymbologyStyle As Integer, ByVal pSymbologyWeight As Integer, _
                              ByVal pBorderColor As Color, ByVal pFillColor As Color, ByVal pTooltip As String)

            _SymbologyStyle = pSymbologyStyle
            _SymbologyWeight = pSymbologyWeight
            _BorderColor = pBorderColor
            _FillColor = pFillColor
            _Tooltip = pTooltip

        End Sub

        Sub SetDataSource(ByVal pDBName As String, ByVal pDB As String, ByVal pTable As String, _
                          ByVal pAtributes() As Object)

            Dim DS As New SRAGWM.DataSource(pDBName, pDB, pTable, pAtributes)

            _DataSource = DS

        End Sub
        Sub SetFilter(ByVal pWhereClause As String, ByVal pPoints() As Object, ByVal pNumPairs As Double, _
                          ByVal pSpatialOperator As Integer)

            Dim F As New SRAGWM.Filter(pWhereClause, pPoints, pNumPairs, pSpatialOperator)

            _Filter = F

        End Sub
    End Class
End Namespace


